import { Ref } from "vue";

export default function OperationHook(state: {
  formRef: Ref<any>;
  emit: {
    (e: "submit"): void;
    (e: "update:visible", visible: boolean): void;
  };
}) {
  const { formRef, emit } = state;

  const resetForm = () => {
    formRef.value.resetFields();
    emit("update:visible", false);
  };
  return {
    resetForm
  };
}
